package br.com.mtech.ctrlliberty.ejb.util;

import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;


public class MailHelper {
	
	private MailHelper() {}
	
	public static void enviarEmail(String emailUsuario, String mensagem){  
		  
        SimpleEmail email = new SimpleEmail();  
                
        try {  
	        email.setDebug(false);  
	        email.setHostName("smtp.gmail.com");  
	        email.setAuthentication("ctrl.liberty","mtech63923");  
	        email.setSSL(true);  
	        email.addTo(emailUsuario);  
	        email.setFrom("ctrl.liberty@gmail.com");  
	        email.setSubject("Alerta de Aviso");  
	        email.setMsg(mensagem);  
	        email.send(); 
  
        } catch (EmailException e) {  
          	System.out.println(e.getMessage());  
        }   
  
    }
}
